@echo off

if "%BUILD_DIR%" == "" set BUILD_DIR=%1
if "%PYTHON_EXE%" == "" set PYTHON_EXE=%2

echo BUILD_DIR=%BUILD_DIR%
echo PYTHON_EXE=%PYTHON_EXE%

if exist %~dp0\!unittest_%BUILD_DIR%.log del /Q %~dp0\!unittest_%BUILD_DIR%.log
if exist %~dp0\!unittest_%BUILD_DIR%.log del /Q %~dp0\!unittest_%BUILD_DIR%.err
if exist %~dp0\build\%BUILD_DIR%\diabind.pyd %PYTHON_EXE% %~dp0\unittest\diabindtest.py %~dp0\build\%BUILD_DIR% > %~dp0\!unittest_%BUILD_DIR%.log 2> %~dp0\!unittest_%BUILD_DIR%.err